package model.metier;
// Generated 4 mars 2015 13:49:36 by Hibernate Tools 4.3.1


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Client generated by hbm2java
 */
@Entity
@Table(name="client"
    ,catalog="stocks_bdd"
)
public class Client extends Metier implements java.io.Serializable {


     private Integer id;
     private TypeClient typeClient;
     private String nom;
     private String adresse;
     private String tel;
     private Set<CommandeClient> commandeClients = new HashSet(0);

    public Client() {
    }

	
    public Client(TypeClient typeClient, String nom, String adresse, String tel) {
        this.typeClient = typeClient;
        this.nom = nom;
        this.adresse = adresse;
        this.tel = tel;
    }
    public Client(TypeClient typeClient, String nom, String adresse, String tel, Set<CommandeClient> commandeClients) {
       this.typeClient = typeClient;
       this.nom = nom;
       this.adresse = adresse;
       this.tel = tel;
       this.commandeClients = commandeClients;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id", unique=true, nullable=false)
    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_type_client", nullable=false)
    public TypeClient getTypeClient() {
        return this.typeClient;
    }
    
    public void setTypeClient(TypeClient typeClient) {
        this.typeClient = typeClient;
    }

    
    @Column(name="nom", nullable=false)
    public String getNom() {
        return this.nom;
    }
    
    public void setNom(String nom) {
        this.nom = nom;
    }

    
    @Column(name="adresse", nullable=false)
    public String getAdresse() {
        return this.adresse;
    }
    
    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    
    @Column(name="tel", nullable=false, length=45)
    public String getTel() {
        return this.tel;
    }
    
    public void setTel(String tel) {
        this.tel = tel;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="client")
    public Set<CommandeClient> getCommandeClients() {
        return this.commandeClients;
    }
    
    public void setCommandeClients(Set<CommandeClient> commandeClients) {
        this.commandeClients = commandeClients;
    }




}


